<template>
  <view class="story-board">
    <view class="close" :style="{top}" @tap="timeup">
      <uni-countdown :show-day="false" :show-hour="false" :show-minute="false" :second="10" @timeup="timeup"/>
      <view class="text">s | 关闭</view>
    </view>
  </view>
</template>

<script setup>
  import { computed } from 'vue'
  const { safeArea } = uni.getSystemInfoSync()
  const top = computed(() => safeArea.top + 20 + 'px')
  const timeup = () => uni.reLaunch({ url: '/pages/index/index' })
</script>

<style lang="scss" scoped>
  .story-board {
    position: relative;
    width: 750rpx;
    height: 100vh;
    background-color: aqua;
    .close {
      position: absolute;
      right: 20px;
      padding: 8px 20px;
      color: #FFF;
      background-color: rgba(0, 0, 0, .3);
      border-radius: 20px;
      display: flex;
      font-size: 12px;
      :deep(.uni-countdown__number) {
        color: #FFF !important;
        font-size: 12px !important;
        line-height: 12px !important;
      }
      .text {
        line-height: 12px;
      }
    }
  }
</style>
